package com.config;

import com.bean.My;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import redis.clients.jedis.Jedis;

/**
 * @author: 一个小菜逼
 * @Date: 2020/4/28
 */
@Configuration
public class RedisConfig {

    //返回的Bean的name默认是方法名getInstanceRedis，可以在@Bean注解中进行指定Bean的name...
    @Bean("jedis")
    public Jedis getInstaceRedis(){
        Jedis jedis = new Jedis("192.168.1.108", 6379);
        return jedis;
    }

//    @Bean
//    public My getInstanceMy(){
//        return new My();
//    }
}
